package cn.zc.tools.security.securityEntity;

import cn.zc.student.entity.VO.StudentAndClassifyVO;
import lombok.Data;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;
@Data
public class SecurityUser implements UserDetails {
    private String id;
    private String password;
    private final String username;
    private final List<GrantedAuthority> authorities;
    private List<StudentAndClassifyVO> studentAndClassifyVO;
    private static final long serialVersionUID = 530L;
    private static final Log logger = LogFactory.getLog(User.class);
    private final boolean accountNonExpired;
    private final boolean accountNonLocked;
    private final boolean credentialsNonExpired;
    private final boolean enabled;

    public SecurityUser(String id, String password, String username, List<GrantedAuthority> authorities, List<StudentAndClassifyVO> studentAndClassifyVO, boolean accountNonExpired, boolean accountNonLocked, boolean credentialsNonExpired, boolean enabled) {
        this.id = id;
        this.password = password;
        this.username = username;
        this.authorities = authorities;
        this.studentAndClassifyVO = studentAndClassifyVO;
        this.accountNonExpired = accountNonExpired;
        this.accountNonLocked = accountNonLocked;
        this.credentialsNonExpired = credentialsNonExpired;
        this.enabled = enabled;
    }
}